package com.atguigu.eduservice.controller.front;

import com.atguigu.commonutils.R;
import com.atguigu.eduservice.entity.frontvo.VideoUrlVo;
import com.atguigu.eduservice.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @create: 2022/10/10
 * @Description:
 * @FileName: VideoFrontController
 * @自定义内容：
 */
@RestController
@RequestMapping("/eduservice/videoFront")
public class VideoFrontController {

    @Autowired
    private VideoService videoService;

    //根据视频id，获取视频路径，播放视频
    @GetMapping("getPlayerAuth/{videoId}")
    public R getPlayerAuth(@PathVariable String videoId) {
        VideoUrlVo videoUrl = videoService.getPlayerAuth(videoId);
        return R.ok().data("videoUrl",videoUrl);
    }
}
